<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Supplier extends Model
{
    protected $table = 'supplier';

    public static $statusLabels = [
        0 => '冻结',
        1 => '正常',
    ];

    /**
     * 获取某个公司的供应商名字数组
     *
     * @param $agent_id
     * @return mixed
     */
    public static function getSupplierNames($agent_id)
    {
        return self::where('agent_id', $agent_id)->where('status', 1)->pluck('name', 'id')->toArray();
    }
}
